package com.hutao.medical.common.util;


public class DocPather {
	
	public String url = "E://";//E:
	public String path = "MrDoc";//MrDoc
	public String realPath = "MrDoc";//MrDoc
	
	public String source = "source";
	public String thumbnail_ = "thumbnail_";
	public String thumbnail = "thumbnail";
	
	

	
	public static String getMrPre(String randomNum){
		String $x1j5p1d6k9g0w0g5 = randomNum.substring(randomNum.length()-4,randomNum.length()-2);
		String $x1j5p1d6k9g0j6d6 = randomNum.substring(randomNum.length()-2);
		return "/"+$x1j5p1d6k9g0w0g5+"/"+$x1j5p1d6k9g0j6d6;
	}
	

	// 注释：文件上传保存路径
	public String getUploadImagePath(String randomNum, String fileName, String $orgCode) {
		
		String $s = url+
			path+
			"/"+$orgCode+
			"/"+this.source+
			getMrPre(randomNum)+"/"+randomNum+
			"/"+fileName;
		return $s;
	}
	
	//获取生成png的路径
	public String getPngPath(String fileName){
		return  fileName.replaceAll( this.source,this.thumbnail_).replaceAll("tif", "png");
	}
	
	
	//截取文件名称
	public String getAbsoluteFileName(String fileName){
		return fileName.substring(fileName.lastIndexOf("/")+1);
	}
	
	//替换文件后缀名称tif为png
	public String  relaceFilenameSuffix(String fileName){
		return fileName.replace("tif", "png");
	}
	
	
	
	
	



}
